//package com.chengfei.controller;
//
//import cn.afterturn.easypoi.excel.ExcelImportUtil;
//import cn.afterturn.easypoi.excel.entity.ImportParams;
//import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
//import com.chengfei.entity.GameUser;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestMapping;
//import utils.AESUtil;
//import utils.FileUtil;
//
//import javax.servlet.http.HttpServletResponse;
//import java.io.File;
//import java.io.FileInputStream;
//import java.util.ArrayList;
//import java.util.List;
//
///**
// * @author chengfei5
// * @date 2018/10/9
// */
//@Controller("poi")
//public class EasyPoiController {
//    private String seed="a050969fa0d4439e";
//    private String iv="ad8eecf24af89268";
//    @RequestMapping("export")
//    public void export(HttpServletResponse response) { //模拟从数据库获取需要导出的数据
//        File file = new File("D:\\京东彩娱\\from 李芳\\斗地主晋级赛每日前30名选手名单（10.1~10.7）\\京东排行榜京豆\\matchRank9_2018-10-02-00-00.xls");
//        ImportParams params = new ImportParams();
//        params.setTitleRows(1);
//        params.setHeadRows(1);
//        ImportParams importParams = new ImportParams();
//        ExcelImportResult<GameUser> result = null;
//        try {
//            result = ExcelImportUtil.importExcelMore(new FileInputStream(file), GameUser.class,
//                    importParams);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//
//        List<GameUser> list = result.getList();
//        List<GameUser> newList = new ArrayList<GameUser>();
//        for(GameUser people:list){
//            people.setUserPin(AESUtil.decrypt(people.getOpenId(),seed,iv));
//            newList.add(people);
////            System.out.println(people);
////            System.out.println(people.getId()+"--"+people.getOpenId()+"---"+ AESUtil.decrypt(people.getOpenId(),seed,iv));
//        }
//        System.out.println(newList);
//        FileUtil.exportExcel(newList,"花名册","草帽一伙",GameUser.class,"海贼王.xls",response);
//
//    }
//}
